{{--{{ Form::open(array('route' => 'customers.login','files'=>true,'id'=>'pages')) }}--}}
{{--<input type="text" name="name">--}}
{{--<input type="text" name="mobile">--}}
{{--<select name="p_id">--}}
{{--<option value="3">山西省</option>--}}
{{--</select>--}}
{{--<select name="c_id">--}}
{{--<option value="4">太原市</option>--}}
{{--</select>--}}
{{--<input type="radio" name="sex" value="1">nan--}}
{{--<input type="radio" name="sex" value="2">nv--}}



{{--<input type="submit">--}}
{{--{{ Form::close() }}--}}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>雷谛净水器-用户中心</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" type="text/css" href="{{ URL::asset('newstyle/css/drink.css') }}" />
    <script type="text/javascript" src="{{ URL::asset('front/js/jquery.min.js') }}"></script>
</head>
<body>
<header id="header">
  <a href="{{ route('customers.index') }}">
    <img src="{{ URL::asset('newstyle/images/arrow_left.png') }}" alt="" width="8" class="arrow_left">
  </a>
  <h3>@if($se == 2)联系方式@elseif($se == 1)姓名@endif</h3>
</header>
 {{ Form::model($customer, array('method' => 'put', 'route' => array('customers.update', $customer->id),'files'=>true,'id'=>'customers')) }}
<div class="edit_tel">
@if($se == 2)
  <span><input type="text" name="mobile"></span>
  <p>请输入你的手机</p>
  @elseif($se == 1)
    <span><input type="text" name="name"></span>
    <p>请输入你的姓名</p>

  @elseif($se == 3)
    <span>
                      <select  name="p_id" id="select" onchange=check(this.value) >
                        <option value="0">请选择</option>
                        @foreach($areas as $area)
                          <option value="{{ $area->id }}">{{ $area->name }}</option>
                        @endforeach
                      </select>
                      <select name="c_id" id="select2">
                      </select></span>
    <p>修改城市</p>
  @endif

</div>
<div class="keep">

    @if($se == 3)
        <input type="submit" value="保存">

    @else
        <input type="submit" value="保存">
    @endif
</div>
{{ Form::close() }}
</body>
<script>
    function check(id){
        $.post('{{ route('customers.ajax') }}',{id : id},function(data){
            $('#select2').html(data);
        })
    }
    $(function(){

        $("#pages").validate({
            rules: {
                name: "required",
                sex: "required",
                p_id: "required",
                mobile: "required",
                c_id: "required"
            },
            messages: {
                name: "",
                sex: "",
                p_id: "",
                mobile: "",
                c_id: ""
            }
        });
    });
</script>
</html>
